package edu.uc.disastercrowdmap;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.CheckBox;

public class MainActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}
	
	/** Called when the user clicks the Report button */
	public void report(View view) {
		System.out.println("Report clicked");
		Intent intent = new Intent(this, ReportActivity.class);
		CheckBox chkMedical = (CheckBox) findViewById(R.id.chkMedical);
		CheckBox chkFood = (CheckBox) findViewById(R.id.chkFood);
		CheckBox chkWater = (CheckBox) findViewById(R.id.chkWater);
		CheckBox chkShelter = (CheckBox) findViewById(R.id.chkShelter);
		CheckBox chkPower = (CheckBox) findViewById(R.id.chkPower);
		CheckBox chkOther = (CheckBox) findViewById(R.id.chkOther);
		
		boolean[] needs = new boolean[6];
		needs[0] = chkMedical.isChecked();
		needs[1] = chkFood.isChecked();
		needs[2] = chkWater.isChecked();
		needs[3] = chkShelter.isChecked();
		needs[4] = chkPower.isChecked();
		needs[5] = chkOther.isChecked();
		
		intent.putExtra("edu.uc.disastercrowdmap.NEED_LIST",needs);
		startActivity(intent);
	}

}
